根据计费 id 创建运单
根据计费 id 创建运单
POST | /v1/open-api/label |
请求头部
标签 | 必填 | 说明 |
---|---|---|
Api-Key | ✓ | Api Key,请登录系统,在我的个人资料中找到 |
Api-Secret | ✓ | Api Secret,请登录系统,在我的个人资料中找到 |
Body请求参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
rate_id | [string] | ✓ | 通过 rate 接口获得的 id |
custom_order_num | [string] | ✓ | |
shipment | [object] | ✓ | - |
﹂ship_from | [object] | ✓ | 发件地址 |
﹂﹂uuid | [string] | 发件地址id, 此字段与ship from 详情二选一,若填了uuid,ship_from地址详情不用填。若没填,则必须填以下地址详情。 点击查看如何获取uuid 示例:22d953b7-24c4-4ae9-afb4-111cc227b01e | |
﹂﹂city | [string] | ✓ | 发件城市 示例:LOS ANGELES |
﹂﹂name | [object] | ✓ | 发件公司名或人名,限制长度:35 示例:Amazon |
[string] | 邮箱 | ||
﹂﹂addresses | [array] | ✓ | 地址详情 示例: 6925 Riverview Ave |
﹂﹂postal_code | [string] | ✓ | 发件邮编,格式[12345]或[12345-6789] 示例:90045-6275 |
﹂﹂country_code | [string] | ✓ | 发件国家二字代码 示例:US |
﹂﹂is_residential | [boolean] | 发件地址是否为住宅地址。true表示住宅地址,false表示商业地址 示例:false | |
﹂﹂state_province_code | [string] | ✓ | 发件州二字代码 示例:CA |
﹂﹂phone | [string] | ✓ | 发件人联系方式,至少10位数字 示例:1000000000 |
﹂﹂attention | [string] | 备注或发件人名,限制长度:35 示例:Ann | |
﹂ship_to | [object] | ✓ | 收件地址 |
﹂﹂city | [string] | ✓ | 收件地址,城市名 Example: PENFIELD |
﹂﹂name | [string] | ✓ | 收件公司名或人名,限制长度:35 示例:Ann |
[string] | 邮箱 | ||
﹂﹂addresses | [array] | ✓ | 地址详情 示例:6925 Riverview Ave |
﹂﹂postal_code | [string] | ✓ | 收件邮编,格式[12345]或[12345-6789] 示例:14526 |
﹂﹂country_code | [string] | ✓ | 收件国家二字代码 示例:US |
﹂﹂is_residential | [boolean] | 发件地址是否为住宅地址。true表示住宅地址,false表示商业地址 示例:false | |
﹂﹂state_province_code | [string] | ✓ | 收件州二字代码 示例:NY |
﹂﹂phone | [string] | ✓ | 发件人联系方式,至少10位数字 示例:(999)-999-9999 |
﹂﹂phone_ext | [string] | 联系方式分机号 限制:1-4位 示例:1234 | |
﹂﹂attention | [string] | 备注或发件人名,限制长度:35 | |
﹂packages | [array] | ✓ | 包裹详情 |
﹂﹂dimension | [object] | ✓ | 包裹尺寸 最大/最小尺寸值因服务和包装类型而异 |
﹂﹂﹂width | [number] | ✓ | 包裹宽度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂height | [number] | ✓ | 包裹高度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂length | [number] | ✓ | 包裹长度,输入数字并且最多输入小数点后两位 示例:20.01 |
﹂﹂﹂code | [string] | ✓ | 长度单位,有效值为:in/cm 示例:in |
﹂﹂weight | [object] | ✓ | 包裹重量 |
﹂﹂﹂code | [string] | ✓ | 重量单位,有效值为:lb/oz/kg/g 注意:输入大写字母会报错 示例:lb |
﹂﹂﹂value | [number] | ✓ | 输入数字并且最多输入小数点后两位 示例:68.25 |
﹂﹂confirmation | [string] | ✓ | 签名服务,点击查看服务商支持的签名服务 示例:None |
﹂﹂insurance | [object] | 保险服务 | |
﹂﹂﹂code | [string] | 货币单位 示例:USD | |
﹂﹂﹂value | [number] | 输入数字并且最多输入小数点后两位 示例:300.01 | |
﹂﹂quantity | [number] | ✓ | 包裹数量 示例:1 |
﹂﹂reference_numbers | [array] | ✓ | 包裹备注 |
﹂﹂﹂code | [string] | ✓ | 备注标题,点击查看服务商支持的备注信息 示例:INVOICE |
﹂﹂﹂value | [object] | ✓ | 备注内容,每个备注限制长度:40 示例:P84746-KMD |
﹂package_type | [object] | ✓ | 包裹类型。点击查看服务商支持的包裹类型 |
﹂﹂type | [string] | ✓ | 示例:common |
﹂﹂name | [string] | ✓ | 示例:Package |
﹂label_specification | [object] | 面单规格 | |
﹂﹂label_format | [string] | 示例:pdf 。可选参数:zpl , pdf | |
﹂pickup_date | [string] | ✓ | 取件日期,格式[yyyymmdd] 示例:20221001 |
curl -X POST \
'https://api.sandbox.shipber.com/v1/open-api/label' \
-H 'Content-Type:application/json' \
-H 'Api-Key:2cn1wgmfidytin3jef3b' \
-H 'Api-Secret:qRBYybjRch7BdTxO5NTyGUd6mBvowNbsjahnAnpdI-BXc5sCrRt15XGr-hc9oY7C' \
-d '{
"rate_id": "eyJzZXJ2aWNlQ29kZSI6InVwc19ncm91bmQiLCJjaGFpbklkIjoyMDAzLCJwYWNrYWdlVHlwZSI6IlBhY2thZ2UifQ==",
"custom_order_num": "cimy-977885",
"shipment": {
"ship_from": {
"uuid": "7b572b8d-08a3-4cc7-a711-1aae28e9ffcf"
},
"ship_to": {
"city": "Kansas City",
"name": "Test Company",
"addresses": [
"6925 Riverview Ave"
],
"postal_code": "66102",
"country_code": "US",
"state_province_code": "KS",
"phone": "0123456789"
},
"packages": [
{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "IN"
},
"weight": {
"code": "lb",
"value": 6
},
"confirmation": "None",
"quantity": 1,
"reference_numbers": [
{
"code": "reference #1",
"value": "1"
}
]
}
],
"package_type": {
"type": "common",
"name": "Package"
},
"label_specification": {
"label_format": "pdf"
},
"pickup_date": "20211010"
}
}'
{
"data": {
"status": "Printing",
"order_num": "ST161853120081597000",
"shipment": {
"ship_from": {
"city": "Kansas City",
"name": "Test Company",
"email": "[email protected]",
"addresses": ["6925 Riverview Ave"],
"postal_code": "66102",
"country_code": "US",
"is_residential": true,
"state_province_code": "KS",
"attention": "",
"phone": "0123456789"
},
"ship_to": {
"country_code": "US",
"phone": "8888888888",
"name": "Test Company",
"addresses": ["6925 Riverview Ave"],
"city": "Kansas City",
"state_province_code": "NC",
"postal_code": "66102",
"attention": ""
},
"packages": [{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "IN"
},
"weight": {
"code": "LBS",
"value": 6
},
"confirmation": "Delivery",
"insurance": {
"code": "USD",
"value": 20
},
"quantity": 1
}],
"package_type": {
"type": "common",
"name": "Package"
},
"label_specification": {
"label_format": "pdf"
},
"pickup_date": "20210416",
"service_code": "fedex_ground"
},
"created_at": "2021-04-16T04:30:28.632Z",
"custom_order_num": "cimy-15913"
}
}
创建退货运单
可以通过将is_return_label设置为true来创建退货运单
curl -X POST \
'https://api.sandbox.shipber.com/v1/open-api/label' \
-H 'Content-Type:application/json' \
-H 'Api-Key:2cn1wgmfidytin3jef3b' \
-H 'Api-Secret:qRBYybjRch7BdTxO5NTyGUd6mBvowNbsjahnAnpdI-BXc5sCrRt15XGr-hc9oY7C' \
-d '{
"is_return_label":true,
"rma_number": "123",
"rma_reason": "Other",
"rate_id": "eyJzZXJ2aWNlQ29kZSI6ImZlZGV4X2dyb3VuZCIsImNoYWluSWQiOjIwMDIsInBhY2thZ2VUeXBlIjoiUGFja2FnZSJ9",
"custom_order_num": "cimy-977885",
"shipment": {
"ship_from": {
"city": "Kansas City",
"name": "Test Company",
"addresses": [
"6925 Riverview Ave"
],
"postal_code": "66102",
"country_code": "US",
"state_province_code": "KS",
"phone": "0123456789"
},
"ship_to": {
"uuid": "7b572b8d-08a3-4cc7-a711-1aae28e9ffcf"
},
"packages": [
{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "IN"
},
"weight": {
"code": "lb",
"value": 6
},
"confirmation": "None",
"quantity": 1,
"reference_numbers": [
{
"code": "reference #1",
"value": "1"
}
]
}
],
"package_type": {
"type": "common",
"name": "Package"
},
"pickup_date": "20211010"
}
}'
{
"data": {
"status": "Printing",
"order_num": "ST161853120081597000",
"shipment": {
"ship_from": {
"country_code": "US",
"phone": "8888888888",
"name": "Test Company",
"addresses": ["6925 Riverview Ave"],
"city": "Kansas City",
"state_province_code": "KS",
"postal_code": "66102",
"attention": ""
},
"ship_to": {
"city": "Kansas City",
"name": "Test Company",
"email": "[email protected]",
"addresses": ["6925 Riverview Ave"],
"postal_code": "66102",
"country_code": "US",
"is_residential": true,
"state_province_code": "KS",
"attention": "",
"phone": "0123456789"
},
"packages": [{
"dimension": {
"width": 7,
"height": 13,
"length": 4,
"code": "IN"
},
"weight": {
"code": "LBS",
"value": 6
},
"confirmation": "Delivery",
"insurance": {
"code": "USD",
"value": 20
},
"quantity": 1
}],
"package_type": {
"type": "common",
"name": "Package"
},
"pickup_date": "20210416",
"service_code": "fedex_ground"
},
"created_at": "2021-04-16T04:30:28.632Z",
"custom_order_num": "cimy-15913"
}
}